$(function(){
	$('#startDate,#endDate').date_input();
	
	//删除事件
	$('#submitBtn').click(function(){
		var $s = $('#startDate');
		var $e = $('#endDate');
		var $p = $('#privilegeName');
		var $m = $('#sysMenu');
		
		//收集参数信息
		var p = new Array();
		p.push('pageActionType=ajax');
		p.push('sqlId=4');
		p.push('paramTotal=4');
		p.push('_param0=' + $s.val());
		p.push('_param1=' + $e.val());
		p.push('_param2=' + $p.val());
		p.push('_param3=' + $m.val());
		
		$('#ajaxRs').jdtTable({
			title:['ID', '名称', 'URL', '所属菜单', '操作员', '创建日期', '操作'],
			url: 'pageAction!listPageForMySQL.ac',
			param: p.join('&'),
			render: [null, null, null, null, null, null, function(data){
				return '<a class="detail" href="#">详情</a>';
			}],
			callback: function(){
				$('#rs a.detail').click(function(){
					alert('privilegeId:' + $(this).parent().siblings('td:eq(0)').text());
				});
			}
		});
		
		return false;
	});
	
	
	/*
	 * 取得所有菜单
	 */
	$.ajax({
		type:'POST',
		dataType:'html',
		url:'sysMenuAction!queryMenuAll2.ac',
		beforeSend:function(){
			jLoading("正在取菜单，请稍后...");
		},
		success:function(rs){
			var $m = $('#sysMenu');
			$m.html(rs);
			setTimeout(function(){
				$m.val($('#sysMenuHidden').val());
				jUnloading();
			},10);
		}
	});
});